package cc.core.ccequalizer

import android.media.MediaPlayer
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    lateinit var mediaPlayer: MediaPlayer
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        mediaPlayer = MediaPlayer.create(this, R.raw.cpnv)
        EqHolder.init(mediaPlayer.audioSessionId, this)
        mediaPlayer.start()
        btn.setOnClickListener {
            EqDialog(this).show()
        }
    }

    override fun onDestroy() {
        super.onDestroy()
        mediaPlayer.release()
        EqHolder.saveEq()
    }
}
